import $http from './config'

//网站域名路径
export const baseHost = $http.baseHost

//接口地址路径
export const baseUrl = $http.baseUrl

// 登录
export const login = params => {
  return $http.post('/manager/login', params).then(res => res.data)
}
export const logout = params => {
  return $http.post('/manager/logout').then(res => res.data)
}

// 上传图片
export const uploadImg = params => {
  return $http.post('/upload/image', params)
}

/*
   页面管理
*/

// 获取 首页轮播
export const getHomeBanner = params => {
  return $http.post('/rotation_chart/finds', params)
}
// 获取 首页轮播详情
export const getHomeBannerdetail = params => {
  return $http.post('/rotation_chart/detail', params)
}
// 添加 首页轮播
export const createHomeBanner = params => {
  return $http.post('/rotation_chart/create', params)
}
// 修改 首页轮播
export const editHomeBanner = params => {
  return $http.post('/rotation_chart/edit', params)
}
// 启用或者禁用 首页轮播
export const statusHomeBanner = params => {
  return $http.post('/rotation_chart/isSale', params)
}
// 删除 首页轮播
export const deletesHomeBanner = params => {
  return $http.post('/rotation_chart/delete', params)
}
// 获取 热门搜索
export const getHotSearch = params => {
  return $http.post('/hot_search/finds', params)
}
// 获取 热门搜索详情
export const getHotSearchdetail = params => {
  return $http.post('/hot_search/detail', params)
}
// 添加 热门搜索
export const createHotSearch = params => {
  return $http.post('/hot_search/create', params)
}
// 修改 热门搜索
export const editHotSearch = params => {
  return $http.post('/hot_search/edit', params)
}
// 启用或者禁用 热门搜索
export const statusHotSearch = params => {
  return $http.post('/hot_search/isSale', params)
}
// 删除 热门搜索
export const deletesHotSearch = params => {
  return $http.post('/hot_search/delete', params)
}

/*
   商品管理
*/

// 获取 商品列表
export const getGoods = params => {
  return $http.post('/goods/finds', params)
}
// 获取 商品详情
export const getGoodsdetail = params => {
  return $http.post('/goods/detail', params)
}
// 添加 商品
export const createGoods = params => {
  return $http.post('/goods/create', params)
}
// 修改 商品
export const editGoods = params => {
  return $http.post('/goods/edit', params)
}
// 启用或者禁用 商品
export const statusGoods = params => {
  return $http.post('/goods/isSale', params)
}
// 删除 商品
export const deletesGoods = params => {
  return $http.post('/goods/delete', params)
}
// 获取 商品分类
export const getCategory = params => {
  return $http.post('/category/finds', params)
}
// 获取 商品子分类
export const getChildCategory = params => {
  return $http.post('/category/getChild', params)
}
// 获取 商品分类
export const getCategorydetail = params => {
  return $http.post('/category/detail', params)
}
// 添加 商品分类
export const createCategory = params => {
  return $http.post('/category/create', params)
}
// 修改 商品分类
export const editCategory = params => {
  return $http.post('/category/edit', params)
}
// 启用或者禁用 商品分类
export const statusCategory = params => {
  return $http.post('/category/status', params)
}
// 删除 商品分类
export const deletesCategory = params => {
  return $http.post('/category/delete', params)
}


/*
   视频管理
*/

// 获取 视频列表
export const getVideo = params => {
  return $http.post('/video/finds', params)
}
// 获取 视频详情
export const getVideodetail = params => {
  return $http.post('/video/detail', params)
}
// 添加 视频
export const createVideo = params => {
  return $http.post('/video/create', params)
}
// 修改 视频
export const editVideo = params => {
  return $http.post('/video/edit', params)
}
// 启用或者禁用 视频
export const statusVideo = params => {
  return $http.post('/video/status', params)
}
// 删除 视频
export const deletesVideo = params => {
  return $http.post('/video/delete', params)
}
// 获取 视频分类
export const getVideoCategory = params => {
  return $http.post('/video_group/finds', params)
}
// 获取 视频分类
export const getVideoCategorydetail = params => {
  return $http.post('/video_group/detail', params)
}
// 添加 视频分类
export const createVideoCategory = params => {
  return $http.post('/video_group/create', params)
}
// 修改 视频分类
export const editVideoCategory = params => {
  return $http.post('/video_group/edit', params)
}
// 启用或者禁用 视频分类
export const statusVideoCategory = params => {
  return $http.post('/video_group/status', params)
}
// 删除 视频分类
export const deletesVideoCategory = params => {
  return $http.post('/video_group/delete', params)
}

/*
  订单管理
*/

// 获取 订单列表
export const getOrder = params => {
  return $http.post('/order/finds', params)
}
// 获取 订单详情
export const getOrderdetail = params => {
  return $http.post('/order/detail', params)
}
// 添加 订单
export const createOrder = params => {
  return $http.post('/order/create', params)
}
// 修改 订单
export const editOrder = params => {
  return $http.post('/order/edit', params)
}
// 启用或者禁用 订单
export const statusOrder = params => {
  return $http.post('/order/status', params)
}
// 删除 订单
export const deletesOrder = params => {
  return $http.post('/order/delete', params)
}


/*
  用户管理
*/

// 获取 用户列表
export const getUser = params => {
  return $http.post('/customer/finds', params)
}
// 获取 用户详情
export const getUserdetail = params => {
  return $http.post('/customer/detail', params)
}
// 添加 用户
export const createUser = params => {
  return $http.post('/customer/create', params)
}
// 修改 用户
export const editUser = params => {
  return $http.post('/customer/edit', params)
}
// 启用或者禁用 用户
export const statusUser = params => {
  return $http.post('/customer/status', params)
}
// 删除 用户
export const deletesUser = params => {
  return $http.post('/customer/delete', params)
}

/*
  资金管理
*/

// 获取 提现列表
export const getWithdrawalApply = params => {
  return $http.post('/withdrawal_apply/finds', params)
}
// 获取 提现详情
export const getWithdrawalApplydetail = params => {
  return $http.post('/withdrawal_apply/detail', params)
}
// 提现审核
export const statusWithdrawalApply = params => {
  return $http.post('/withdrawal_apply/status', params)
}
